<blockquote class="layui-elem-quote quoteBox">
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                <@shiro.hasPermission name="core/schedule/index:add">
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" id="btnAddPage">
                            <i class="layui-icon layui-icon-add-circle"></i>添加
                        </button>
                    </div>
                </@shiro.hasPermission>
        </div>
    </div>
    <table id="dataList" class="layui-table" lay-filter="dataList" lay-skin="row"></table>
</blockquote>
<script id="editTpl" type="text/html">
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 15px;">
                <form class="layui-form" id="scheduleForm" lay-filter="scheduleForm">
                    <input type="hidden" name="id" value="0">
                    <div class="layui-form-item">
                        <label class="layui-form-label">任务名称</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" placeholder="请输入任务名称" lay-verType="tips"
                                   lay-verify="required" name="jobName">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">任务分组</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" placeholder="请输入任务分组" lay-verType="tips"
                                   lay-verify="required" name="jobGroup">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">执行表达式</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" placeholder="请输入执行表达式" lay-verType="tips"
                                   lay-verify="required" name="cronExpression">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">任务描述</label>
                        <div class="layui-input-block">
                            <textarea name="jobDescription" placeholder="请输入任务描述" class="layui-textarea"></textarea>
                        </div>
                    </div>
                    <input type="hidden" lay-submit=""
                       <@shiro.hasPermission name="core/schedule/index:add or core/schedule/index:update">
                        lay-filter="modifyData"
                       </@shiro.hasPermission> id="btnAdd"/>
                </form>
            </div>
        </div>
    </div>
</script>
<script id="opTpl" type="text/html">

    {{# if (d.jobStatus == 'PAUSED'){}}
    <@shiro.hasPermission name="core/schedule/index:start">
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="start" lay-tips="立即运行">
        <i class="layui-icon layui-icon-play"></i>
    </a>
    </@shiro.hasPermission>
    {{# }else{}}
    <@shiro.hasPermission name="core/schedule/index:stop">
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="stop" lay-tips="暂停">
        <i class="layui-icon layui-icon-pause"></i>
    </a>
    </@shiro.hasPermission>
    {{#}}}
    <@shiro.hasPermission name="core/schedule/index:runNow">
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="runNow" lay-tips="立即运行一次">
        <i class="layui-icon layui-icon-play"></i>
    </a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="core/schedule/index:update">
    <a class="layui-btn layui-btn-sm" lay-event="edit" lay-tips="编辑任务">
        <i class="layui-icon layui-icon-edit"></i>
    </a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="core/schedule/index:delete">
    <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del" lay-tips="删除任务"><i
            class="layui-icon layui-icon-delete"></i></a>
    </@shiro.hasPermission>
</script>
<script>
    var fn = {};
    layui.config({
        base: '/static/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'core/schedule']);
</script>